package com.example.demo.controller.dto;

import com.example.demo.model.User;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * Created by xdkxlk on 2017/8/11.
 */
@Data
public class UserDTO {

    private int id;
    private String name;

    public static UserDTO convertFor(User user) {
        UserDTO userDTO = new UserDTO();

        BeanUtils.copyProperties(user, userDTO);

        return userDTO;
    }
}
